package com.example.dao;

import com.example.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

@Mapper
public interface UserRepository {

    @Select("select * from tb_User where id = #{id}")
    User selectmoney(int id);

    @Update("update tb_User set money = #{money} where id = #{id}")
    void updatemoney(int id, int money);

    @Insert("insert into tb_consumeordrawback values (#{id},#{money},#{addtime})")
    void addconsumeordrawback(int id, String consumeordrawback, Date addtime);

    @Select("select * from tb_consumeordrawback  where id = #{id} order by addtime ")
    List<User> selectconsumeordrawback(int id);


}
